package Runde4;

public class Node {

	private Node leftChild;
	private Node rightChild;
	private final String label;
	
	/**
	 * @precondition label.length() > 0 and label != NULL
	 * @postcondition Creates a new node with given string as label
	 * @param label - The created node's label
	 */
	public Node (String label) {
		this.label = label;
	}

	/**
	 * @postcondition Sets the node's right child
	 * @param rightChild - Node to set as right child
	 */
	public void setRightChild(Node rightChild) {
		this.rightChild = rightChild;
	}

	/**
	 * @postcondition Returns the node's right child
	 */
	public Node getRightChild() {
		return rightChild;
	}

	
	/**
	 * @postcondition Sets the node's left child
	 * @param rightChild - Node to set as left child
	 */
	public void setLeftChild(Node leftChild) {
		this.leftChild = leftChild;
	}

	/**
	 * @postcondition Returns the node's left child
	 */
	public Node getLeftChild() {
		return leftChild;
	}
	
	/**
	 * @postcondition Returns a readable output of node / the nodes label
	 */
	public String toString(){
		return label;
	}
	
}
